package com.lfs.market.model.vo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lfs.market.listener.UserInfoGenderConverter;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author lfs
 * @date 2025/6/24 13:52:44
 */
@Data
@HeadRowHeight(value = 30) // 头部行高
@ContentRowHeight(value = 25) // 内容行高
@ColumnWidth(value = 20) // 列宽
/**
 * @OnceAbsoluteMerge 指定从哪一行/列开始,哪一行/列结束,进行单元格合并
 * firstRowIndex 起始行索引,从0开始
 * lastRowIndex 结束行索引
 * firstColumnIndex 起始列索引,从0开始
 * lastColumnIndex 结束列索引
 */
public class UserExcelVo {
    /**
     * 用户标识
     */
    @ApiModelProperty("用户标识")
    @TableId(value = "id")
    @ExcelProperty(value = {"用户标识"}, index = 0)
    // 忽略导出字段
//    @ExcelIgnore
    private String id;

    /**
     * 头像
     */
    @ApiModelProperty("头像")
    @ExcelProperty(value = {"头像"}, index = 1)
    private String avatar;

    /**
     * 个人简介
     */
    @ApiModelProperty("个人简介")
    @ExcelProperty(value = {"个人简介"}, index = 2)
    private String intro;

    /**
     * 昵称
     */
    @ApiModelProperty("昵称")
    @ExcelProperty(value = {"昵称"}, index = 3)
    private String nickName;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号", example = "0")
    @ExcelProperty(value = "手机号", index = 4)
    private Long phone;
    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    @ExcelProperty(value = "性别", converter = UserInfoGenderConverter.class)
    private Integer gender;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "0")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelProperty(value = "创建时间", index = 5)
    private Date createTime;
}
